#pragma once
#include "MeshLoader.h"
#include <vector>
#include <d3dx9.h>
#include "OBB.h"
class SimpleMeshLoader: public MeshLoader
{
	struct Vertex
	{
		D3DXVECTOR3 pos;
		D3DXVECTOR3 norm;
		D3DXVECTOR2 uv;
	};
	IDirect3DDevice9 *device;

	IDirect3DVertexBuffer9 *vBuffer;
	IDirect3DIndexBuffer9 *iBuffer;
	IDirect3DVertexDeclaration9 *vdecl;
	
	std::vector<D3DXVECTOR3> positions;
	std::vector<D3DXVECTOR3> normals;
	std::vector<D3DXVECTOR2> texCoords;
	std::vector<DWORD> indices;

	OBB obb;
	

public:
	SimpleMeshLoader( std::string path, IDirect3DDevice9 *device );
	virtual ~SimpleMeshLoader();

	IDirect3DVertexBuffer9 *GetVertices();
	IDirect3DIndexBuffer9 *GetIndices();
	IDirect3DVertexDeclaration9 *GetVertexDeclaration();
	UINT GetStride();
	OBB GetOBB();
	UINT GetVertexCount();
	UINT GetTriangleCount();
};